﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;
using WSManager.Model;

namespace WSManager.ModelValidation
{
    public class CategoryValidator: AbstractValidator<Category>
    {
        public CategoryValidator()
        {
            RuleFor(c => c.Id).NotEmpty();
            RuleFor(c => c.Name).NotNull();
            RuleFor(c => c.Subcategories).NotNull().SetCollectionValidator(this);
            RuleFor(c => c.Description).NotNull();
        }
    }
}
